import request from '@/utils/request'

export default {
  // 账号授权回调
  authCallback(data) {
    return request({
      baseURL: window.APP_GETEWAY.pms,
      url: `/v1/purchase-config/purchase-account/auth-callback`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // amazon店铺-授权
  authAmazon(data) {
    return request({
      baseURL: window.APP_GETEWAY.base,
      url: `/v1/shop/amazon/auth`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // amazon店铺-更新授权
  updateAuth(data) {
    return request({
      baseURL: window.APP_GETEWAY.base,
      url: `/v1/shop/amazon/update-auth`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 广告授权
  adAuth(data) {
    return request({
      baseURL: window.APP_GETEWAY.base,
      url: `/v1/shop/amazon/ad-auth`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // eBay授权
  eBayAuth(data) {
    return request({
      baseURL: window.APP_GETEWAY.base,
      url: `/v1/shop/ebay/get-ebay-token`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 通用授权
  auth(data) {
    return request({
      baseURL: window.APP_GETEWAY.base,
      url: `/v1/shop/general/auth`,
      method: 'post',
      data,
      returnData: true
    })
  },
  //飞书授权
  getFeishuCalendarSubscribe(data) {
    return request({
      url: "/feishu-calendar/subscribe",
      method: "POST",
      data,
      returnData: true
    });
  }
}
